<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div class="bjui-pageHeader">
		<form:form modelAttribute="templateForm">
			<form:hidden path="pageSize"/>
			<form:hidden path="pageCurrent"/>
			<div class="bjui-searchBar">
				<a href="<c:url value="/admin/message/reset_template"/>" class="btn btn-primary" data-toggle="doajax" data-confirm-msg="是否重置所有模板">重置所有模板</a>
			</div>
		</form:form>
	</div>
	<div class="bjui-pageContent tableContent">
		<table class="table table-bordered table-hover table-striped table-top">
			<thead>
				<tr>
					<th>编号</th>
					<th>模板内容</th>
					<th>模板类型</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${templates.iterator() }" var="obj">
					<tr>
						<td>${obj.code }</td>
						<td>
							<c:choose>
								<c:when test="${obj.type eq 'PHONE' }">
									${obj.content }
								</c:when>
								<c:otherwise>
									##请点击编辑查看##
								</c:otherwise>
							</c:choose>
						
						</td>
						<td>${obj.type }</td>
						<td>
							<a href="<c:url value="/admin/message/template_edit"><c:param name="code" value="${obj.code }"/></c:url>" data-toggle="dialog" class="btn btn-green">编辑内容</a>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
	<div class="bjui-pageFooter">
    <div class="pages">
        <span>每页&nbsp;</span>
        <div class="selectPagesize">
            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
                <option value="30">30</option>
                <option value="60">60</option>
                <option value="120">120</option>
                <option value="150">150</option>
            </select>
        </div>
        <span>&nbsp;条，共 600 条</span>
    </div>
    <div class="pagination-box" data-toggle="pagination" data-total="600" data-page-size="30" data-page-current="1">
    </div>
</div>
</body>
</html>